﻿using HelloASPNET.TruyXuatDuLieu;
using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HelloASPNET.Test
{
  public partial class ThongTinThanhVien : System.Web.UI.Page
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      if (Request.QueryString["user"] == null)
      {
        Response.Redirect("DemoDataBinding.aspx");
      }
      //Select theo username
      string username = Request.QueryString["user"];
      DataTable tbl = TienIchSQL.ChayLenhSelectDuLieu("SELECT * FROM NguoiDung WHERE Username=@Username", "@Username", username);
      if (tbl.Rows.Count == 0)
      {
        TienIch.TienIchWeb.MsgBox(this, "Username " + username + " khong ton tai");
      }
      else
      {
        lblHoTen.Text = (string)tbl.Rows[0]["HoTen"];
        lblUsername.Text = (string)tbl.Rows[0]["username"];
      }
    }
  }
}